<!--添加会员-->
<div class="dialog_content">
	<form id="info_form" action="{:u('user/add')}" method="post">
	<table width="100%" class="table_form">
		<tr>
			<th width="100">会员昵称 :</th>
			<td>
				<input type="text" id="username" name="username" class="input-text" />
				<input type="hidden" name="email" class="input-text" value="{$info.email}" size="30">
			</td>
		</tr>
	    <tr>
			<th>会员头像 :</th>
			<td>
            	<input type="text" name="img" id="J_img" class="input-text fl mr10" size="30" value="{$info.img}">
            	<div id="J_upload_img" class="upload_btn"><span>{:L('upload')}</span></div>
				<notempty name="info['img']"><span class="attachment_icon J_attachment_icon" file-type="image" file-rel="{$img_dir}{$info.img}"><img src="__STATIC__/images/filetype/image_s.gif" /></span></notempty>
            </td>
		</tr>
        <tr>
			<th>真实姓名 :</th>
			<td><input type="text" name="truename" id="truename" class="input-text" value="{$info.truename}" size="30"></td>
		</tr>
		<tr>
			<th>身份证号 :</th>
			<td><input type="text" name="idcard" id="idcard" class="input-text" value="{$info.idcard}" size="27"></td>
		</tr>
		<tr>
			<th>电话 :</th>
			<td><input type="text" name="tel" id="tel" class="input-text" value="{$info.tel}" size="27"></td>
		</tr>
		<tr>
			<th>银行账号 :</th>
			<td><input type="text" name="bankaccount" id="bankaccount" class="input-text" value="{$info.bankaccount}" size="27"></td>
		</tr>
		<tr>
			<th>开户行 :</th>
			<td><input type="text" name="bankname" id="bankname" class="input-text" value="{$info.bankname}" size="27"></td>
		</tr>
		<tr>
			<th>用户类型 :</th>
			<td>
				<select name="usertype">
					<option value="汽车膜">汽车膜</option>
					<option value="建筑膜">建筑膜</option>
				</select>
			</td>
		</tr>
        
        <tr>
			<th>新密码 :</th>
			<td><input type="password" name="password" class="input-text" size="30"></td>
		</tr>
        <tr>
			<th>重复密码 :</th>
			<td><input type="password" name="repassword" class="input-text" size="30"></td>
		</tr>
        
	    <tr>
			<th>{:L('enabled')} :</th>
			<td>
				<label><input type="radio" name="status" value="1" <if condition="$info.status eq 1">checked</if>> {:L('yes')}</label>&nbsp;&nbsp;
				<label><input type="radio" name="status" value="0" <if condition="$info.status eq 0">checked</if>> {:L('no')}</label>
			</td>
		</tr>
	</table>
	<input type="hidden" name="id" value="{$info.id}" />
	</form>
</div>
<script src="__STATIC__/js/fileuploader.js"></script>
<script>
var check_name_url = "{:U('user/ajax_check_name')}";
var check_email_url = "{:U('user/ajax_check_email')}";
$(function(){
	$.formValidator.initConfig({formid:"info_form",autotip:true});
	$("#username").formValidator({onshow:'请填写用户名',onfocus:'请填写用户名'}).inputValidator({min:1,onerror:'请填写用户名'}).ajaxValidator({
	    type : "get",
		url : check_name_url,
		datatype : "json",
		async:'false',
		success : function(result){	
            if(result.status == 0){
                return false;
			}else{
                return true;
			}
		},
		onerror : '用户昵称已经存在',
		onwait : '正在检测'
	}).defaultPassed();
	
	$('#info_form').ajaxForm({success:complate,dataType:'json'});
	function complate(result){
		if(result.status == 1){
			$.dialog.get(result.dialog).close();
            $.pinphp.tip({content:result.msg});
            window.location.reload();
		} else {
			$.pinphp.tip({content:result.msg, icon:'alert'});
		}
	}
	
});
</script>